﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_ManufactureList.cshtml";
}
<script type="text/javascript">
    var col1 = [
                { label: '容器编号', name: '', width: 80, align: 'center' },
                { label: '容器名称', name: '', width: 80, align: 'center' }
    ];

   
    $(function () {
        initControl();
        gridList();
    });
    function initControl() {
        var myLayout = $('#layout').layout({ resizable: false });
        $('select').bindSelect();
        $('#recommend-element').on('change', function () {
            var flag = $('#recommend-element').val();
            //alert(flag);
            if (flag == 'recommend1') {
                showList1();
            }
        })
    }
    function gridList() {
        var $gridList1 = $("#gridList1");
        $gridList1.dataGrid({
            //url: "/SystemManage/User/GetGridJson",
            height: $(window).height() - 280,
            colModel: col1,
            sortname: 'F_DepartmentId asc,F_CreatorTime desc',
            viewrecords: true
        });
       

        showList1();
    }

    function showList1() {
        $("#grid111").show();
     
       
    }

    function btn_add() {
        var flag = $('#recommend-element').val();
        var title = '';
        var url = '';
        if (flag == 'recommend1') {
            title = '选择容器';
            url = '/MainData/Storage/Recommend2Container';
        }
        $.detailOpen2({
            id: "Detail",
            title: title,
            url: url
        });
    }
    function btn_ok() {
        parent.$.detailClose();
    }
    function btn_cancel() {
        parent.$.detailClose();
    }
</script>
<div class="ui-layout" id="layout" style="height: 100%; width: 100%;">
    <div class="ui-layout-center">
        <form id="form1">
            <div style="width:950px;margin:0 auto;">
                <table class="form" style="width:900px;text-align:right;margin:15px;border-bottom:2px solid #ccc;">
                    <tr>
                        <td class="formValue input-width-185" style="width:500px;padding-left:100px;text-align:left;">
                            &nbsp;
                        </td>
                        <td style="width: 300px; padding: 5px 10px;">
                            <div class="btn-group" style="margin-right:20px;">
                                <a id="" class="btn btn-primary center-block" onclick="btn_ok()"><span class="glyphicon glyphicon-ok"></span> 确认</a>
                            </div>
                            <div class="btn-group">
                                <a id="" class="btn btn-primary center-block" onclick="btn_cancel()"><span class="glyphicon glyphicon-remove"></span> 取消</a>
                            </div>
                        </td>
                    </tr>
                </table>
                <table class="form" style="width: 900px;" >
                    <tr>
                        <th class="formTitle">货位类型</th>
                        <td class="formValue input-width-320">
                            <select id="" name="" class="form-control">
                                <option>1-区号-平面存放</option>
                                <option>2-架号-货架存放</option>
                                <option>3-层号-分层存放</option>
                                <option>4-单元-货架单元</option>
                                <option>5-单元-存储单元</option>
                            </select>
                        </td>
                        <th class="formTitle">货架编号</th>
                        <td class="formValue input-width-105">
                            <input id="" type="text" class="form-control" value="" />
                            <label class="prefix">层数</label><input id="" type="text" class="form-control input-width-40" value="" />
                            <label class="prefix">列数</label><input id="" type="text" class="form-control input-width-40" value="" />                        
                        </td>                        
                    </tr>
                    <tr>
                        <th class="formTitle">单位仓库</th>
                        <td class="formValue input-width-320">
                            <select id="" name="" class="form-control">
                                <option>1-容器库1</option>
                                <option>2-容器库2</option>
                            </select>
                        </td>
                        <th class="formTitle">货架层号</th>
                        <td class="formValue input-width-320">
                            <input id="" type="text" class="form-control" value="" />
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">区位编号</th>
                        <td class="formValue input-width-105">
                            <input id="" type="text" class="form-control" value="" />
                        </td>
                        <th class="formTitle">货架列号</th>
                        <td class="formValue input-width-320">
                            <input id="" type="text" class="form-control" value="" />
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">优先级别</th>
                        <td class="formValue input-width-320">
                            <select id="" name="" class="form-control">
                                <option>1-一级-主要存储区</option>
                                <option>2-二级-中转存储区</option>
                                <option>3-三级-临时存储区</option>
                            </select>
                        </td>
                        <th class="formTitle">使用标志</th>
                        <td class="formValue input-width-320">
                            <select id="" name="" class="form-control">
                                <option>Y-使用</option>
                                <option>N-冻结</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">推荐方式</th>
                        <td class="formValue input-width-240">
                            <select id="recommend-element" name="" class="form-control">
                                <option value="recommend1">1-按容器推荐</option>
                               
                               
                            </select>
                            <div class="btn-group" style="margin-left:5px;">
                                <a id="" class="btn btn-primary center-block btn-1" onclick="btn_add()"><span class="glyphicon glyphicon-plus"></span> 新增</a>
                            </div>
                        </td>
                        <th class="formTitle">货位说明</th>
                        <td class="formValue input-width-320">
                            <input id="" type="text" class="form-control" value="" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <div style="padding: 5px 0 5px 20px;">
                                <div id="grid111" style="width:100%">
                                    <table id="gridList1"></table>
                                </div>
                                <div id="grid222" style="width: 100%">
                                    <table id="gridList2"></table>
                                </div>                            
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </form>
    </div>
</div>

